<script setup lang="ts">
import { onMounted, inject, defineProps, ref, nextTick, reactive } from 'vue'
import { setWinSizeKey } from '../model/type'
import { searchMems, getMemDetailApi } from '../api/index'
import { RouterLink, useRouter } from 'vue-router';
const router = useRouter()
const handleWinSize = inject(setWinSizeKey)
const props = defineProps(['content'])
interface MemType {
    title: string,
    content: string,
}
const meminfo = reactive({
    title: ''


})
const resultItems = ref<MemType[]>([])
const loadSearchResult = async () => {
    const dict = { 'content': props.content, 'pageNo': pageNo, 'pageSize': pageSize }
    const res = await searchMems(dict)
    resultItems.value = res.result

}
const pageNo = ref(1)
const pageSize = ref(20)
nextTick(() => {
    handleWinSize!()

})
const itemDetail = async (item: any) => {
    const dict = {}
    //const res = await getMemDetailApi(dict)
    //router.push({ name: '/memEditor', params: {'memId':item.memId} })
    router.push('/memEditor')



}
onMounted(() => {
    //loadSearchResult()


})
</script>
<template>
    <n-list id="queryForm" ref="nlist" style="" hoverable clickable>
        <n-list-item v-for="(item, index) in 10" :key="index" style="height: 50px; " @click="itemDetail">
            <span style="font-size: 12px;font-weight: 600;">我的计划任务</span><br>
            <span style="font-weight: 100;">我们创建了一个 Menu 对象来定义主窗口菜单。然后，我们将其传递给主窗口的 .set_menu() 方</span>
        </n-list-item>

    </n-list>
</template>
<style scoped></style>